package Test;

import com.pojo.Customer;
import com.pojo.Student;
import com.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class StudentTest {
    @Test
    public void findStudentByNameOrMajorTest() {
        SqlSession Session = MyBatisUtils.getSqlSession();
        Student student = new Student();
        student.setSname("tom");
        student.setMajor("计应");
        List<Student> list = Session.selectList("com.mapper.StudentMapper.findStudentByNameOrMajor",student);
        for (Student s : list) {

        }
        Session.close();

    }
    @Test
    public void findByArrayTest() {
        SqlSession session = MyBatisUtils.getSqlSession();
        Integer[] roleIds = {1,2,3,4};
        List<Student> Students  = session.selectList("com.mapper.CustomerMapper.findByArray",roleIds );
        for (Student student: Students) {
            System.out.println(student);
        }
        session.commit();
        session.close();

    }
}
